<!--
 Author: Omar
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr">

    <head>
        
        <script>
            var g;
            function reFresh() {
                  g.updateStore('/reportqueue/data');
            }
            /* Set the number below to the amount of delay, in milliseconds,
            you want between page reloads: 1 minute = 60000 milliseconds. */    
            window.setInterval("reFresh()",6000);

dojo.addOnLoad(function(){
                // The formatter function 'link' -> author: Eman
                function link(value){
                if (value[0] == "Download"){
                return '<a href="/reports/'+value[1]+'.xls" style="color: green; font-size: 15px;">Download</a>';
                }
                return value[0];
            }
                g=new myGrid();
                g.setLayout([
                [{
                    field: "id",
                    name: "Id"
                },{
                    field: "criteria",
                    name: "Criteria",
                    width: "auto"
                },{
                    fields: ["progress","id"],
                    name: "Progress",
                    width: 20,
                    formatter: link
                },{
                    field: "created_at",
                    name: "Started at",
                    width: 20
                },{
                    field: "updated_at",
                    name: "Completed at",
                    width: 20
                }]]);
            var url="/reportqueue/data";
            g.setStore(url);
            g.createGrid();
            g.addGrid('show');
            });

        </script>
        <link rel="stylesheet" type="text/css" href="http://report.com/css/paginate.css"/>
        <style type="text/css">
            body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
        </style>
        <!--
        http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js
        -->
        <link rel="stylesheet" type="text/css" href="http://report.com/js/dojo/dijit/themes/soria/soria.css"
              />
        <link rel="stylesheet" type="text/css" href="http://report.com/js/dojo/dojox/grid/resources/Grid.css"
              />

        <link rel="stylesheet" type="text/css" href="http://report.com/js/dojo/dojox/grid/resources/soriaGrid.css"
              />

    </head>

    <body class=" soria ">
            <?php $user = $this->users; ?>
            <div id="show" class="divrow" style="height: 300px;width: auto;"></div>

    </body>

</html>
